<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
	</head>
	<body>
		<script type="text/javascript">
			/*打印1-100所有质数*/
			for(var i = 2; i <= 100;i++){
				//创建布尔值保存质数
				var flag = true;
				//判断质数
				for(var j = 2; j < i;j++){
					if(i%j == 0){
						flag = false;
						//如果进入判断i不是质数
					}
				}
				if(flag == true){
					console.log(i);
				}
				
			}
		</script>
	</body>
</html>
